#ifndef ZHONGZHITABLEWIDGET_H
#define ZHONGZHITABLEWIDGET_H

#include <QObject>
#include <QWidget>
#include "QTableWidget"
#include "QHeaderView"
#include "QPushButton"
#include "bean/zhongzhibean.h"

class ZhongZhiTableWidget : public QTableWidget
{
    Q_OBJECT

    enum colType{
        numType =0,
        cropType = 1,
        productType = 2,
        deleteType = 3

    };
public:
    explicit ZhongZhiTableWidget(QWidget *parent = nullptr);
    void init();
    int creatNewRow(int num = 0, QString crop = "", QString type= "");
    bool isCreateTableFinish();
    bool getAllTableBeans(QList<ZhongZhiBean*> *allZhongZhiBeans);
    bool getBean(int row, ZhongZhiBean *zhongZhiBean);
    bool saveBeans2File();
    void readZhongZhiBeansSetting(QList<ZhongZhiBean> &zhongzhiBeans);
signals:
    void logEvent(QString log);
};

#endif // ZHONGZHITABLEWIDGET_H
